laravel find or create new

33

laravel find or create new -

$user = User::firstOrCreate(
    ['email' =>  request('email')],
    ['name' => request('name')]
);
 
// No call to $user->save() needed

Comments

Submit
0 Comments